Technotes


Pictures and Clip Regions



Technote QD 11January 1986



Revised by: March 1988
Written by: Jennifer Jernigan January 1986

This note describes a problem that affects creation of QuickDraw pictures.


When a GrafPort is created, the fields in the GrafPort are given default values; one of these is the clip region, which is set to the rectangle (-32767, -32767, 32767, 32767). If you create a picture, then call DrawPicture with a destination rectangle that is not the same size as the picFrame without ever changing the default clip region, nothing will be drawn.

When the picture frame is compared with the destination rectangle and the picture is scaled, the clip region is scaled too. In the process of scaling, the clip region you end up overflows and becomes empty, and your picture doesn't get drawn. If you call ClipRect(thePort^.portRect) before you record the picture, the picture will be drawn correctly. The clipping on the destination port when playing back the picture is irrelevant: once a picture is incorrectly recorded, it is too late.

Further Reference:




Technotes
Previous Technote | Contents | Next Technote